#!/bin/bash


curl -L --output /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64
chmod +x /usr/local/bin/gitlab-runner 
useradd --comment 'GitLab Runner' --create-home gitlab-runner --shell /bin/bash
gitlab-runner install --user=gitlab-runner --working-directory=/home/gitlab-runner
/usr/local/bin/gitlab-runner install --user=gitlab-runner --working-directory=/home/gitlab-runner
/usr/local/bin/gitlab-runner start

#registration-token在gitlab的界面上查看获取，路径是 project/CICD/setting
 /usr/local/bin/gitlab-runner register --url https://gitlab.test123.com/ --registration-token dFx_edqcm8WNz3zeM85N 